package com.mengfx.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mengfx.bean.User;
import com.mengfx.mapper.UserMapper;
import com.mengfx.service.UserService;
import com.mengfx.vo.UserVo;
@Service("userService")
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserMapper userMapper;

	public UserVo UserConvertUserVo(Long userId) {
		User user = userMapper.selectByPrimaryKey(userId);
		UserVo userVo = new UserVo();
		if(null != user){
			userVo.setUserId(user.getCustomerId());
			userVo.setUserName(user.getFirstName());
		}
		return userVo;
	}

	public List<User> tmpUserList() {
		// TODO Auto-generated method stub
		return userMapper.tmpUserList();
	}

	public boolean insertTmpUser(User user) {
		// TODO Auto-generated method stub
		return userMapper.insertSelective(user) > 0;
	}

	@Override
	public List<User> pushAllUser() {
		// TODO Auto-generated method stub
		return userMapper.pushAllUser();
	}

	@Override
	public List<User> internetRed() {
		return userMapper.internetRed();
	}

	@Override
	public List<User> searchUser(String name) {
		return userMapper.searchUser(name);
	}

	@Override
	public boolean lockUser(Long userId) {
		return userMapper.lockUser(userId) > 0;
	}
	
}
